package com.xbongbong.paas.constant;

import com.xbongbong.saas.enums.XbbRefTypeEnum;

import java.util.Arrays;
import java.util.List;

/**
 * excel常量类
 * @author 魏荣杰
 * @date 2019/11/12 4:38 下午
 * @since v4.6.0
 * @version v4.6.0
 */
public class ExcelConstant {
    /**
     * 列元素
     */
    public static final String C_ELEMENT = "c";
    /**
     * 列中属性r
     */
    public static final String R_ATTR = "r";
    /**
     * 列中的v元素
     */
    public static final String V_ELEMENT = "v";
    /**
     * 列中的t元素
     */
    public static final String T_ELEMENT = "t";
    /**
     * 列中属性值
     */
    public static final String S_ATTR_VALUE = "s";
    /**
     * 列中属性值
     */
    public static final String T_ATTR_VALUE = "t";
    /**
     * sheet r:Id前缀
     */
    public static final String RID_PREFIX = "rId";
    /**
     * 表格范围标签
     */
    public static final String DIMENSION_ELEMENT = "dimension";
    /**
     * 行元素
     */
    public static final String ROW_ELEMENT = "row";
    /**
     * 合并单元格组前缀
     */
    public static final String MERGE_CELLS_ELEMENT = "mergeCells";
    /**
     * 合并单元格前缀
     */
    public static final String MERGE_CELL_ELEMENT = "mergeCell";
    /**
     * 合并单元格组的数量属性值，表示该表内的所有合并单元格数量
     */
    public static final String MERGE_CELLS_COUNT_ATTR_VALUE = "count";
    /**
     * 合并单元格属性值，获取合并单元格的范围，如A1:G5
     */
    public static final String MERGE_CELL_REF_ATTR_VALUE = "ref";
    /**
     * 时间格式化字符串
     */
    public static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
    /**
     * saxParser
     */
    public static final String CLASS_SAXPARSER = "org.apache.xerces.parsers.SAXParser";
    /**
     * 填充字符串
     */
    public static final String CELL_FILL_STR = "@";
    /**
     * 列的最大位数
     */
    public static final int MAX_CELL_BIT = 3;
    /**
     * excel2003扩展名
     */
    public static final String EXCEL03_EXTENSION = ".xls";
    /**
     * excel2007扩展名
     */
    public static final String EXCEL07_EXTENSION = ".xlsx";
    /**
     * 解析Excel时下拉选项会被解析成隐藏的sheet，用于过滤
     */
    public static final String HIDDEN_SHEET = "hiddenSheet";
    /**
     * 每个sheet存储的记录数 100W
     */
    public static final Integer PER_SHEET_ROW_COUNT = 1000000;

    /**
     * 每次向EXCEL写入的记录数(查询每页数据大小) 20W
     */
    public static final Integer PER_WRITE_ROW_COUNT = 200000;


    /**
     * 每个sheet的写入次数 5
     */
    public static final Integer PER_SHEET_WRITE_COUNT = PER_SHEET_ROW_COUNT / PER_WRITE_ROW_COUNT;


    /**
     * 读取excel的时候每次批量插入数据库记录数
     */
    public static final Integer PER_READ_INSERT_BATCH_COUNT = 100;

    /**
     * 导出excel的时候分片处理导出数据的大小
     */
    public static final Integer PER_WRITE_INSERT_BATCH_COUNT = 1000;

    /**
     * 用于获取坐标数字部分的正则
     */
    public static final String RANGE_CHECK_REGEX = "[A-Z]+";
    /**
     * 用于获取坐标字母部分的正则
     */
    public static final String RANGE_CHECK_COORDINATE_REGEX = "\\d+";
    /**
     * 分割合并单元格的符号
     */
    public static final String COORDINATE_SPLIT = ":";
    /**
     * 处理表头用的分隔符
     */
    public static final String TITLE_SPLIT = "|@|";
    /**
     * 处理表头用的分隔符
     */
    public static final String TITLE_SPLIT_REGEX = "\\|@\\|";

    /**
     * 库存流水，批次流水，序列号查询，价目表，营销活动管理，促销活动管理，核销记录
     */
    public static final List<Integer> LARGE_NUM_BUSINESS = Arrays.asList(XbbRefTypeEnum.STOCK_FLOW_BILL.getCode(), XbbRefTypeEnum.BATCH_FLOW_BILL.getCode(), XbbRefTypeEnum.SEQ_SEARCH.getCode(), XbbRefTypeEnum.PRICE_SET_PRODUCT.getCode(), XbbRefTypeEnum.MARKETING_ACTIVITY_MANAGEMENT.getCode(), XbbRefTypeEnum.PROMOTION_ACTIVITY_MANAGEMENT.getCode(),XbbRefTypeEnum.WRITE_OFF_RECORD.getCode(), XbbRefTypeEnum.STOCK_STANDING_BOOK.getCode());

    /**
     * 客户
     */
    public static final  List<Integer> FIFTY_THOUSAND_BUSINESS = Arrays.asList(XbbRefTypeEnum.CUSTOMER_MANAGEMENT.getCode());




}
